package com.shenyaocn.android.dualcamera;

import android.content.Intent;
import android.content.pm.PackageInstaller;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Environment;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;

import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;

public class Mains extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_mains);
        TextView tv= (TextView) findViewById(R.id.versioncode);

        Intent it = getIntent();
        String cmd = it.getStringExtra("cmd");
        if (cmd==null) {
            Intent its = new Intent(this, DebugAct.class);
            startActivityForResult(its,300);
        }else{
            if (cmd.equals("login")||cmd.equals("logout")) {
                it.setClass(this,MainActivity.class);
            }else if(cmd.equals("random")){
                it.setClass(this,Random.class);
            }else if(cmd.equals("takepicnow")){
                it.putExtra("type",cmd);
                it.setClass(this,TakePicNow.class);
            }
            startActivityForResult(it,200);
        }


    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        finish();
    }
}
